---
title: Installation & Auth
description: Install the Latitude CLI and authenticate with your API key.
---

## Install

```bash
npm i -g @latitude-data/cli
# or
pnpm add -g @latitude-data/cli
# or
yarn global add @latitude-data/cli
```

Verify installation:

```bash
latitude --version
```

## Authenticate

Set your API key once using the system keychain:

```bash
latitude login
```

- Provide `--api-key <key>` to skip the prompt
- Use `-f/--force` to override without confirmation

### Environment variable (CI/containers)

You can also provide `LATITUDE_API_KEY` as an environment variable. If set, it takes precedence over the stored key.

```bash
export LATITUDE_API_KEY=your_api_key
```

Unset the variable to use the stored key again.

## Development mode

Add `--dev` to any command to target a local Gateway at `localhost:8787`:

```bash
latitude status --dev
```

This is handy when running Latitude in development on your machine.
